package org.jeecg.modules.manage.service.impl;

import org.jeecg.modules.manage.entity.StyleAccessoryInfo;
import org.jeecg.modules.manage.entity.StyleElectroplateInfo;
import org.jeecg.modules.manage.entity.StyleInfo;
import org.jeecg.modules.manage.entity.StyleOtherInfo;
import org.jeecg.modules.manage.entity.StyleStoneInfo;
import org.jeecg.modules.manage.entity.StyleSuitInfo;
import org.jeecg.modules.manage.entity.StyleWorkingProcedure;
import org.jeecg.modules.manage.mapper.StyleAccessoryInfoMapper;
import org.jeecg.modules.manage.mapper.StyleElectroplateInfoMapper;
import org.jeecg.modules.manage.mapper.StyleInfoMapper;
import org.jeecg.modules.manage.mapper.StyleOtherInfoMapper;
import org.jeecg.modules.manage.mapper.StyleStoneInfoMapper;
import org.jeecg.modules.manage.mapper.StyleSuitInfoMapper;
import org.jeecg.modules.manage.mapper.StyleWorkingProcedureMapper;
import org.jeecg.modules.manage.service.IStyleInfoService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 款式资料
 * @Author: jeecg-boot
 * @Date:   2021-09-06
 * @Version: V1.0
 */
@Service
public class StyleInfoServiceImpl extends ServiceImpl<StyleInfoMapper, StyleInfo> implements IStyleInfoService {

	@Autowired
	private StyleInfoMapper styleInfoMapper;
	@Autowired
	private StyleStoneInfoMapper styleStoneInfoMapper;
	@Autowired
	private StyleAccessoryInfoMapper styleAccessoryInfoMapper;
	@Autowired
	private StyleWorkingProcedureMapper styleWorkingProcedureMapper;
	@Autowired
	private StyleElectroplateInfoMapper styleElectroplateInfoMapper;
	@Autowired
	private StyleSuitInfoMapper styleSuitInfoMapper;
	@Autowired
	private StyleOtherInfoMapper styleOtherInfoMapper;
	
	@Override
	@Transactional
	public void delMain(String id) {
		styleStoneInfoMapper.deleteByMainId(id);
		styleAccessoryInfoMapper.deleteByMainId(id);
		styleWorkingProcedureMapper.deleteByMainId(id);
		styleElectroplateInfoMapper.deleteByMainId(id);
		styleSuitInfoMapper.deleteByMainId(id);
		styleOtherInfoMapper.deleteByMainId(id);
		styleInfoMapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			styleStoneInfoMapper.deleteByMainId(id.toString());
			styleAccessoryInfoMapper.deleteByMainId(id.toString());
			styleWorkingProcedureMapper.deleteByMainId(id.toString());
			styleElectroplateInfoMapper.deleteByMainId(id.toString());
			styleSuitInfoMapper.deleteByMainId(id.toString());
			styleOtherInfoMapper.deleteByMainId(id.toString());
			styleInfoMapper.deleteById(id);
		}
	}
	
}
